package com.dandelion.business.service;

import com.dandelion.business.entity.SysMenu;
import com.dandelion.business.entity.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dandelion.business.entity.vo.user.CurrentUser;
import com.dandelion.business.entity.vo.user.req.QueryUserListReqVO;
import com.dandelion.business.entity.vo.user.req.UserReqVO;
import com.dandelion.framework.common.R;

import java.util.ArrayList;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author 宋发准
 * @since 2021-12-25
 */
public interface ISysUserService extends IService<SysUser> {

    /**
     * 加载用户根据用户名
     *
     * @param username 用户名
     * @return {@link SysUser}
     */
    SysUser loadUserByUsername(String username);

    /**
     * 查询权限关键字
     *
     * @param id id
     * @return {@link ArrayList}<{@link String}>
     */
    ArrayList<SysMenu> queryPerms(Long id);

    /**
     * 添加
     *
     * @param currentUser  铜
     * @param req 要求事情
     * @return {@link R}<{@link Boolean}>
     */
    R<Boolean> add(CurrentUser currentUser, UserReqVO req);

    /**
     * 查询用户
     *
     * @param id id
     * @return {@link R}<{@link Boolean}>
     */
    R<SysUser> queryUser(Long id);

    /**
     * 编辑用户
     *
     * @param currentUser  铜
     * @param req 要求事情
     * @return {@link R}<{@link Boolean}>
     */
    R<Boolean> editUser(CurrentUser currentUser, UserReqVO req);

    /**
     * 用户列表
     *
     * @param req 要求事情
     * @return {@link R}
     */
    R userList(QueryUserListReqVO req);
}
